# coding:utf-8
import time

from lib.base import Base

from page.android import train_12306_order_list_page

__author__ = 'weixin.yuan'


class Train12306OrderList(Base):
    """12306订单"""
    def __init__(self, method_name):
        Base.__init__(self, method_name)

        """
        本页元素
        """
        self.order_btn = train_12306_order_list_page.elements['12306订单详情']
        self.order_list_title = train_12306_order_list_page.elements['12306订单详情title']
        self.index = train_12306_order_list_page.elements['12306订单列表title']
        self.no_order = train_12306_order_list_page.elements['暂无12306订单']
        self.cancel = train_12306_order_list_page.elements['取消订单']
        """
        外部页面元素
        """

    def test_12306_order_list(self):
        """12306订单"""
        self.open_schema_android('6008')
        self.check(self.index)
        self.click(self.order_btn)
        self.check(self.order_list_title)
        self.click(self.cancel, is_necessary=False)
